package com.bwie.system.controller;

import com.bwie.common.domain.YouHui;
import com.bwie.common.domain.YouXiang;
import com.bwie.common.result.Result;
import com.bwie.system.service.YouService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("you")
@CrossOrigin
public class YouController {


    @Autowired
    YouService youService;


    @PostMapping("youAdd")
    public Result youAdd (@RequestBody YouHui  youHui){
        youService.youAdd(youHui);
        return Result.success();
    }

    @DeleteMapping("youdel/{youId}")
    public Result youdel(@PathVariable("youId") Integer youId){
        youService.youdel(youId);
        return Result.success();
    }

    @PutMapping("updd")
    public Result updd(@RequestBody YouXiang youXiang){
        youService.updd(youXiang);
        return Result.success();
    }

    @PutMapping("upddde")
    public Result upddde(@RequestBody YouXiang youXiang){
        youService.upddde(youXiang);
        return Result.success();
    }

}
